package model

import (
	"auth/model/entity"
)

type UserJobCreateRequest struct {
	UserId int64 `json:"user_id" validate:"required"`

	JobId int64 `json:"job_id" validate:"required"`
}

type UserJobUpdateRequest struct {
	UserId int64 `json:"user_id" validate:"required"`

	JobId int64 `json:"job_id" validate:"required"`
}

type UserJobListRequest struct {
	Index int `json:"index"`
	Size  int `json:"size"`

	UserId int64 `json:"user_id" validate:"required"`

	JobId int64 `json:"job_id" validate:"required"`
}

type UserJobListResponse struct {
	Total int            `json:"total"`
	Data  []*UserJobInfo `json:"data"`
}

type UserJobInfo struct {
	UserId int64 `json:"user_id"`

	JobId int64 `json:"job_id"`
}

type UserJobDeleteRequest struct {
}

func UserJobsEntityToDto(userJobs []*entity.UserJob) []*UserJobInfo {
	out := make([]*UserJobInfo, 0, len(userJobs))
	for _, c := range userJobs {
		out = append(out, UserJobEntityToDto(c))
	}
	return out
}

func UserJobEntityToDto(e *entity.UserJob) *UserJobInfo {
	return &UserJobInfo{

		UserId: e.UserId,

		JobId: e.JobId,
	}
}
